texture2D diffuseTexture : DIFFUSE< 
	string name = "WhiteTex.dds"; 
	string UIName = "Diffuse Texture";
>;

SamplerState diffuseSampler
{
	Filter = MIN_MAG_MIP_LINEAR;
	AddressU = WRAP;
	AddressV = WRAP;
};

matrix g_World : World;
matrix g_WorldInv : WorldInverseTranspose;
matrix g_WVP : WorldViewProjection;
matrix g_ViewInv : ViewInverse;

struct VS_INPUT
{
    float3 Pos          : POSITION;         //position
    float3 Norm		: NORMAL;
    float2 Tex          : TEXCOORD0;        //texture coordinate
};

struct PS_INPUT
{
    float4 Pos : SV_POSITION;
    float3 Norm : TEXCOORD0;
    float4 WorldPos : TEXCOORD1;
    float2 Tex : TEXCOORD2;
};


//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PS_INPUT VS( VS_INPUT input )
{
    PS_INPUT output = (PS_INPUT)0;
    float4 hPos = float4(input.Pos, 1);
    output.Pos = mul(hPos, g_WVP);
    output.WorldPos = mul(hPos, g_World);
    output.Norm = mul(input.Norm, (float3x3)g_World);
    output.Norm = -normalize(output.Norm);
    output.Tex = input.Tex;
    
    return output;
}


//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------

float4 PS( PS_INPUT input) : SV_Target
{
	float som = (floor(input.Tex.x * 10)) + (floor(input.Tex.y * 10));
	if(fmod(som,2) == 1)
		return float4(1,1,1,1);
	else
		return float4(0,0,0,1);
}


//--------------------------------------------------------------------------------------
// Technique
//--------------------------------------------------------------------------------------
technique10 Render
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, VS() ) );
        SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, PS() ) );
    }
}

